package cn.wh.mybatis.session;

import cn.wh.mybatis.builder.xml.XMLConfigBuilder;
import cn.wh.mybatis.session.defaults.DefaultSqlSessionFactory;

import java.io.Reader;

/**
 * @Description
 * @Version 1.0.0
 * @Date 2022/12/28 14:10
 * @Created wh
 */
public class SqlSessionFactoryBuilder {

    public SqlSessionFactory build(Reader reader){
        XMLConfigBuilder xmlConfigBuilder=new XMLConfigBuilder(reader);
        return build(xmlConfigBuilder.parse());
    }

    public SqlSessionFactory build(Configuration configuration){
        return new DefaultSqlSessionFactory(configuration);
    }

}
